using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;

namespace CKY.AgentPlatform.Agents
{
    /// <summary>
    /// Agent执行应用服务接口
    /// </summary>
    public interface IAgentExecutionAppService : IApplicationService
    {
        /// <summary>
        /// 执行Agent任务
        /// </summary>
        /// <param name="agentId">Agent ID</param>
        /// <param name="input">执行输入</param>
        /// <returns>执行结果</returns>
        Task<AgentExecutionResultDto> ExecuteAsync(Guid agentId, ExecuteAgentInput input);

        /// <summary>
        /// 批量执行Agent任务
        /// </summary>
        /// <param name="input">批量执行输入</param>
        /// <returns>批量执行结果</returns>
        Task<BatchExecutionResultDto> BatchExecuteAsync(BatchExecuteAgentInput input);

        /// <summary>
        /// 流式执行Agent任务
        /// </summary>
        /// <param name="agentId">Agent ID</param>
        /// <param name="input">执行输入</param>
        /// <returns>流式执行结果</returns>
        IAsyncEnumerable<StreamingExecutionResultDto> ExecuteStreamingAsync(Guid agentId, ExecuteAgentInput input);

        /// <summary>
        /// 获取Agent执行状态
        /// </summary>
        /// <param name="executionId">执行ID</param>
        /// <returns>执行状态</returns>
        Task<ExecutionStatusDto> GetExecutionStatusAsync(Guid executionId);

        /// <summary>
        /// 停止Agent执行
        /// </summary>
        /// <param name="executionId">执行ID</param>
        /// <returns>停止结果</returns>
        Task<StopExecutionResultDto> StopExecutionAsync(Guid executionId);

        /// <summary>
        /// 获取Agent执行历史
        /// </summary>
        /// <param name="agentId">Agent ID</param>
        /// <param name="input">查询参数</param>
        /// <returns>执行历史</returns>
        Task<PagedResultDto<ExecutionHistoryDto>> GetExecutionHistoryAsync(Guid agentId, GetExecutionHistoryInput input);

        /// <summary>
        /// 获取Agent执行统计
        /// </summary>
        /// <param name="agentId">Agent ID</param>
        /// <returns>执行统计</returns>
        Task<AgentExecutionStatsDto> GetExecutionStatsAsync(Guid agentId);
    }
}